package org.example;

import net.sf.cglib.proxy.CallbackFilter;
import java.lang.reflect.Method;

public class CglibCallbackFilter implements CallbackFilter {


    /**
     返回值 the index into the array of callbacks (as specified by Enhancer.setCallbacks) to use for the method,
     */
    @Override
    public int accept(Method method) {
        if(method.getName().equals("run")) {
            return 1;
        }

        if(method.getName().equals("toString")) {
            return 1;
        }

        return 0;
    }
}